As far as possible, use per-display debug flags.
This will minimize the debug spew that we get from
the inspector if it is running on a separate display.
gboolean gdk_window_supports_edge_constraints (GdkWindow *window);
-GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
-void gdk_display_set_debug_flags (GdkDisplay *display,
- GdkDebugFlags flags);
-
void gdk_window_move_to_rect (GdkWindow *window,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkDebugFlags
gdk_display_get_debug_flags (GdkDisplay *display)
{
- return display->debug_flags;
+ return display ? display->debug_flags : _gdk_debug_flags;
}
void
cairo_region_t *region)
{
GdkGLContext *paint_context;
+ GdkDisplay *display;
cairo_surface_t *image;
double device_x_offset, device_y_offset;
cairo_rectangle_int_t rect, e;
guint target;
paint_context = gdk_gl_context_get_current ();
- if (GDK_DEBUG_CHECK (GL_SOFTWARE) == 0 &&
- paint_context &&
+ if (paint_context)
+ display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (paint_context));
+ else
+ display = NULL;
+
+ if (paint_context &&
+ GDK_DISPLAY_DEBUG_CHECK (display, GL_SOFTWARE) == 0 &&
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface &&
GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, surface, region))
return;
int minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+ GdkDisplay *display;
int version, min_ver;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
/* Enforce a minimum context version number of 3.2 */
version = (major * 100) + minor;
- if (priv->use_es > 0 || GDK_DEBUG_CHECK (GL_GLES))
+ display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
+
+ if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES))
min_ver = 200;
else
min_ver = 302;
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+ GdkDisplay *display;
int default_major, default_minor;
int maj, min;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
- if (priv->use_es > 0 || GDK_DEBUG_CHECK (GL_GLES))
+ display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
+
+ if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES))
{
default_major = 2;
default_minor = 0;
gdk_gl_context_check_extensions (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+ GdkDisplay *display;
gboolean has_npot, has_texture_rectangle;
if (!priv->realized)
priv->is_legacy = TRUE;
}
- if (!priv->use_es && GDK_DEBUG_CHECK (GL_TEXTURE_RECT))
+ display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
+
+ if (!priv->use_es && GDK_DISPLAY_DEBUG_CHECK (display, GL_TEXTURE_RECT))
priv->use_texture_rectangle = TRUE;
else if (has_npot)
priv->use_texture_rectangle = FALSE;
else
g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
- GDK_NOTE (OPENGL,
- g_message ("%s version: %d.%d (%s)\n"
+ GDK_DISPLAY_NOTE (display, OPENGL,
+ g_message ("%s version: %d.%d (%s)\n"
"* GLSL version: %s\n"
"* Extensions checked:\n"
" - GL_ARB_texture_non_power_of_two: %s\n"
extern guint _gdk_debug_flags;
+GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
+void gdk_display_set_debug_flags (GdkDisplay *display,
+ GdkDebugFlags flags);
#ifdef G_ENABLE_DEBUG
-#define GDK_DEBUG_CHECK(type) G_UNLIKELY (_gdk_debug_flags & GDK_DEBUG_##type)
-
-#define GDK_NOTE(type,action) G_STMT_START { \
- if (GDK_DEBUG_CHECK (type)) \
- { action; }; } G_STMT_END
-
-#define GDK_DISPLAY_DEBUG_CHECK(display,type) G_UNLIKELY(gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
+#define GDK_DISPLAY_DEBUG_CHECK(display,type) \
+ G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
+#define GDK_DISPLAY_NOTE(display,type,action) G_STMT_START { \
+ if (GDK_DISPLAY_DEBUG_CHECK (display,type)) \
+ { action; }; } G_STMT_END
#else /* !G_ENABLE_DEBUG */
-#define GDK_DEBUG_CHECK(type) 0
-#define GDK_NOTE(type,action)
#define GDK_DISPLAY_DEBUG_CHECK(display,type) 0
+#define GDK_DISPLAY_NOTE(display,type,action)
#endif /* G_ENABLE_DEBUG */
+#define GDK_DEBUG_CHECK(type) GDK_DISPLAY_DEBUG_CHECK (NULL,type)
+#define GDK_NOTE(type,action) GDK_DISPLAY_NOTE (NULL,type,action)
+
/* Event handling */
typedef struct _GdkEventPrivate GdkEventPrivate;
}
else
{
- GDK_NOTE (VULKAN, g_warning ("Vulkan swapchain doesn't do transparency. Using opaque swapchain instead."));
+ GDK_DISPLAY_NOTE (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)),
+ VULKAN, g_warning ("Vulkan swapchain doesn't do transparency. Using opaque swapchain instead."));
composite_alpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
}
}
}
- if (list_devices || GDK_DEBUG_CHECK (VULKAN))
+ if (list_devices || GDK_DISPLAY_DEBUG_CHECK (display, VULKAN))
{
for (i = 0; i < n_devices; i++)
{
{
if (queue_props[j].queueFlags & VK_QUEUE_GRAPHICS_BIT)
{
- GDK_NOTE (VULKAN, g_print ("Using Vulkan device %u, queue %u\n", i, j));
+ GDK_DISPLAY_NOTE (display, VULKAN, g_print ("Using Vulkan device %u, queue %u\n", i, j));
if (GDK_VK_CHECK (vkCreateDevice, devices[i],
&(VkDeviceCreateInfo) {
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
for (i = 0; i < n_extensions; i++)
{
- GDK_NOTE (VULKAN, g_print ("Extension available: %s v%u.%u.%u\n",
+ if (GDK_DISPLAY_DEBUG_CHECK (display, VULKAN))
+ g_print ("Extension available: %s v%u.%u.%u\n",
extensions[i].extensionName,
VK_VERSION_MAJOR (extensions[i].specVersion),
VK_VERSION_MINOR (extensions[i].specVersion),
- VK_VERSION_PATCH (extensions[i].specVersion)));
+ VK_VERSION_PATCH (extensions[i].specVersion));
if (g_str_equal (extensions[i].extensionName, VK_EXT_DEBUG_REPORT_EXTENSION_NAME))
{
for (i = 0; i < n_layers; i++)
{
- GDK_NOTE (VULKAN, g_print ("Layer available: %s v%u.%u.%u (%s)\n",
+ if (GDK_DISPLAY_DEBUG_CHECK (display, VULKAN))
+ g_print ("Layer available: %s v%u.%u.%u (%s)\n",
layers[i].layerName,
VK_VERSION_MAJOR (layers[i].specVersion),
VK_VERSION_MINOR (layers[i].specVersion),
VK_VERSION_PATCH (layers[i].specVersion),
- layers[i].description));
- if (GDK_DEBUG_CHECK (VULKAN_VALIDATE) &&
+ layers[i].description);
+ if (GDK_DISPLAY_DEBUG_CHECK (display, VULKAN_VALIDATE) &&
g_str_equal (layers[i].layerName, "VK_LAYER_LUNARG_standard_validation"))
{
g_ptr_array_add (used_layers, (gpointer) "VK_LAYER_LUNARG_standard_validation");
}
}
- if (GDK_DEBUG_CHECK (VULKAN_VALIDATE) && !validate)
+ if (GDK_DISPLAY_DEBUG_CHECK (display, VULKAN_VALIDATE) && !validate)
{
g_warning ("Vulkan validation layers were requested, but not found. Running without.");
}
const char *called_function)
{
if (res != VK_SUCCESS)
- {
- GDK_NOTE (VULKAN,g_printerr ("%s(): %s (%d)\n", called_function, gdk_vulkan_strerror (res), res));
- }
+ GDK_NOTE (VULKAN, g_printerr ("%s(): %s (%d)\n", called_function, gdk_vulkan_strerror (res), res));
return res;
}
gdk_display_ref_vulkan (GdkDisplay *display,
GError **error)
{
- GDK_NOTE (VULKAN, g_print ("Support for Vulkan disabled at compile-time"));
+ GDK_NOTE (display, VULKAN, g_print ("Support for Vulkan disabled at compile-time"));
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_UNSUPPORTED,
"Vulkan support was not enabled at compile time.");
g_signal_connect (display, "seat-removed", G_CALLBACK (seat_removed_cb), window);
- if (GDK_DEBUG_CHECK (GL_ALWAYS))
+ if (GDK_DISPLAY_DEBUG_CHECK (display, GL_ALWAYS))
{
GError *error = NULL;
{
GError *internal_error = NULL;
- if (GDK_DEBUG_CHECK (GL_DISABLE))
+ if (GDK_DISPLAY_DEBUG_CHECK (window->display, GL_DISABLE))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- if (GDK_DEBUG_CHECK (VULKAN_DISABLE))
+ if (GDK_DISPLAY_DEBUG_CHECK (window->display, VULKAN_DISABLE))
{
g_set_error_literal (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
_("Vulkan support disabled via GDK_DEBUG"));
sx = sy = 1;
cairo_surface_get_device_scale (window_surface, &sx, &sy);
- if (GDK_DEBUG_CHECK (CAIRO_RECORDING))
+ if (GDK_DISPLAY_DEBUG_CHECK (window->display, CAIRO_RECORDING))
{
cairo_rectangle_t rect = { 0, 0, width * sx, height *sy };
surface = cairo_recording_surface_create (content, &rect);
cairo_surface_set_device_scale (surface, sx, sy);
}
- else if (GDK_DEBUG_CHECK (CAIRO_IMAGE))
+ else if (GDK_DISPLAY_DEBUG_CHECK (window->display, CAIRO_IMAGE))
{
surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 :
content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32,
struct wl_data_source *source,
const char *mime_type)
{
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: Huh? data_source.target() events?\n", data));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: Huh? data_source.target() events?\n", data));
}
static void
if (!gdk_clipboard_write_finish (GDK_CLIPBOARD (clipboard), result, &error))
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), CLIPBOARD, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
g_error_free (error);
}
}
GdkWaylandClipboard *cb = GDK_WAYLAND_CLIPBOARD (data);
GOutputStream *stream;
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: data source send request for %s on fd %d\n",
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source send request for %s on fd %d\n",
source, mime_type, fd));
mime_type = gdk_intern_mime_type (mime_type);
{
GdkWaylandClipboard *cb = GDK_WAYLAND_CLIPBOARD (data);
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
if (cb->source == source)
{
gdk_wayland_clipboard_data_source_dnd_drop_performed (void *data,
struct wl_data_source *source)
{
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_drop_performed() events?\n", data));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
+ CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_drop_performed() events?\n", data));
}
static void
gdk_wayland_clipboard_data_source_dnd_finished (void *data,
struct wl_data_source *source)
{
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_finished() events?\n", data));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
+ CLIPBOARD, g_printerr ("%p: Huh? data_source.dnd_finished() events?\n", data));
}
static void
struct wl_data_source *source,
uint32_t action)
{
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: Huh? data_source.action() events?\n", data));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)),
+ CLIPBOARD, g_printerr ("%p: Huh? data_source.action() events?\n", data));
}
static const struct wl_data_source_listener data_source_listener = {
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_clipboard_read_async);
- GDK_NOTE (CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: read for %s\n", cb, s);
g_free (s); );
mime_type = gdk_content_formats_match_mime_type (formats, cb->offer_formats);
if (cb->source)
{
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
gdk_content_formats_unref (formats);
return;
}
gdk_wayland_clipboard_discard_offer (cb);
- GDK_NOTE (CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: remote clipboard claim for %s\n", cb, s);
g_free (s); );
cb->offer_formats = formats;
{
GdkWaylandSeat *seat = data;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("data device data offer, data device %p, offer %p",
data_device, offer));
if (!GDK_IS_WINDOW (dest_window))
return;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("data device enter, data device %p serial %u, surface %p, x %f y %f, offer %p",
data_device, serial, surface, wl_fixed_to_double (x), wl_fixed_to_double (y), offer));
{
GdkWaylandSeat *seat = data;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("data device leave, data device %p", data_device));
if (!gdk_drag_context_get_dest_window (seat->drop_context))
{
GdkWaylandSeat *seat = data;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("data device motion, data_device = %p, time = %d, x = %f, y = %f",
data_device, time, wl_fixed_to_double (x), wl_fixed_to_double (y)));
{
GdkWaylandSeat *seat = data;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("data device drop, data device %p", data_device));
_gdk_wayland_drag_context_emit_event (seat->drop_context,
&event->crossing.x_root,
&event->crossing.y_root);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("enter, seat %p surface %p",
seat, seat->pointer_info.focus));
&event->crossing.x_root,
&event->crossing.y_root);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("leave, seat %p surface %p",
seat, seat->pointer_info.focus));
&event->motion.x_root,
&event->motion.y_root);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("motion %f %f, seat %p state %d",
wl_fixed_to_double (sx), wl_fixed_to_double (sy),
seat, event->motion.state));
else
seat->pointer_info.button_modifiers &= ~modifier;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("button %d %s, seat %p state %d",
event->button.button,
state ? "press" : "release",
seat->pointer_info.time = time;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("scroll, axis %s, value %f, seat %p",
get_axis_name (axis), wl_fixed_to_double (value) / 10.0,
seat));
{
GdkWaylandSeat *seat = data;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("frame, seat %p", seat));
gdk_wayland_seat_flush_frame_event (seat);
pointer_frame->source = source;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("axis source %s, seat %p", get_axis_source_name (source), seat));
}
pointer_frame->is_scroll_stop = TRUE;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("axis %s stop, seat %p", get_axis_name (axis), seat));
}
g_return_if_reached ();
}
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("discrete scroll, axis %s, value %d, seat %p",
get_axis_name (axis), value, seat));
}
gdk_event_set_device (event, seat->master_keyboard);
gdk_event_set_source_device (event, seat->keyboard);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("focus in, seat %p surface %p",
seat, seat->keyboard_focus));
seat->keyboard_focus = NULL;
seat->repeat_key = 0;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("focus out, seat %p surface %p",
seat, seat->keyboard_focus));
_gdk_wayland_display_deliver_event (seat->display, event);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("keyboard %s event%s, code %d, sym %d, "
"string %s, mods 0x%x",
(state ? "press" : "release"),
mimic_pointer_emulating_touch_info (seat->touch_master, touch);
}
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("touch begin %f %f", event->touch.x, event->touch.y));
_gdk_wayland_display_deliver_event (seat->display, event);
touch = gdk_wayland_seat_get_touch (seat, id);
event = _create_touch_event (seat, touch, GDK_TOUCH_END, time);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("touch end %f %f", event->touch.x, event->touch.y));
_gdk_wayland_display_deliver_event (seat->display, event);
event = _create_touch_event (seat, touch, GDK_TOUCH_UPDATE, time);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("touch update %f %f", event->touch.x, event->touch.y));
_gdk_wayland_display_deliver_event (seat->display, event);
g_hash_table_iter_remove (&iter);
}
- GDK_NOTE (EVENTS, g_message ("touch cancel"));
+ GDK_DISPLAY_NOTE (wayland_seat->display, EVENTS, g_message ("touch cancel"));
}
static void
&event->touchpad_swipe.x_root,
&event->touchpad_swipe.y_root);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("swipe event %d, coords: %f %f, seat %p state %d",
event->any.type, event->touchpad_swipe.x,
event->touchpad_swipe.y, seat,
&event->touchpad_pinch.x_root,
&event->touchpad_pinch.y_root);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("pinch event %d, coords: %f %f, seat %p state %d",
event->any.type, event->touchpad_pinch.x,
event->touchpad_pinch.y, seat,
GdkWaylandSeat *seat = data;
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
- GDK_NOTE (MISC,
+ GDK_DISPLAY_NOTE (seat->display, MISC,
g_message ("seat %p with %s%s%s", wl_seat,
(caps & WL_SEAT_CAPABILITY_POINTER) ? " pointer, " : "",
(caps & WL_SEAT_CAPABILITY_KEYBOARD) ? " keyboard, " : "",
const char *name)
{
/* We don't care about the name. */
- GDK_NOTE (MISC,
+ GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (data)->display, MISC,
g_message ("seat %p name %s", seat, name));
}
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tool->tool);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("proximity in, seat %p surface %p tool %d",
seat, tablet->pointer_info.focus,
gdk_device_tool_get_tool_type (tool->tool)));
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
GdkEvent *event;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("proximity out, seat %p, tool %d", seat,
gdk_device_tool_get_tool_type (tool->tool)));
tablet->pointer_info.surface_x = wl_fixed_to_double (sx);
tablet->pointer_info.surface_y = wl_fixed_to_double (sy);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet motion %f %f",
tablet->pointer_info.surface_x,
tablet->pointer_info.surface_y));
_gdk_device_translate_axis (tablet->current_device, axis_index,
pressure, &tablet->axes[axis_index]);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
g_message ("tablet tool %d pressure %d",
gdk_device_tool_get_tool_type (tool->tool), pressure));
}
_gdk_device_translate_axis (tablet->current_device, axis_index,
distance, &tablet->axes[axis_index]);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
g_message ("tablet tool %d distance %d",
gdk_device_tool_get_tool_type (tool->tool), distance));
}
wl_fixed_to_double (ytilt),
&tablet->axes[ytilt_axis_index]);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
g_message ("tablet tool %d tilt %f/%f",
gdk_device_tool_get_tool_type (tool->tool),
wl_fixed_to_double (xtilt), wl_fixed_to_double (ytilt)));
wl_fixed_to_double (degrees),
&tablet->axes[axis_index]);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
g_message ("tablet tool %d rotation %f",
gdk_device_tool_get_tool_type (tool->tool),
wl_fixed_to_double (degrees)));
_gdk_device_translate_axis (tablet->current_device, axis_index,
position, &tablet->axes[axis_index]);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (GDK_WAYLAND_SEAT (tool->seat)->display, EVENTS,
g_message ("tablet tool %d slider %d",
gdk_device_tool_get_tool_type (tool->tool), position));
}
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkEvent *event;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet tool %d wheel %d/%d",
gdk_device_tool_get_tool_type (tool->tool), degrees, clicks));
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkEvent *frame_event;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet frame, time %d", time));
frame_event = tablet->pointer_info.frame.event;
uint32_t source)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad ring handle source, ring = %p source = %d",
wp_tablet_pad_ring, source));
wl_fixed_t angle)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad ring handle angle, %s ring = %p angle = %f",
wp_tablet_pad_ring, wl_fixed_to_double (angle)));
struct zwp_tablet_pad_ring_v2 *wp_tablet_pad_ring)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad ring handle stop, ring = %p", wp_tablet_pad_ring));
group->axis_tmp_info.is_stop = TRUE;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
GdkEvent *event;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad ring handle frame, ring = %p", wp_tablet_pad_ring));
event = gdk_event_new (GDK_PAD_RING);
uint32_t source)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad strip handle source, strip = %p source = %d",
wp_tablet_pad_strip, source));
uint32_t position)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad strip handle position, strip = %p position = %d",
wp_tablet_pad_strip, position));
struct zwp_tablet_pad_strip_v2 *wp_tablet_pad_strip)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad strip handle stop, strip = %p",
wp_tablet_pad_strip));
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
GdkEvent *event;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad strip handle frame, strip = %p",
wp_tablet_pad_strip));
struct wl_array *buttons)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
uint32_t *p;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad group handle buttons, pad group = %p, n_buttons = %ld",
wp_tablet_pad_group, buttons->size));
struct zwp_tablet_pad_ring_v2 *wp_tablet_pad_ring)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad group handle ring, pad group = %p, ring = %p",
wp_tablet_pad_group, wp_tablet_pad_ring));
struct zwp_tablet_pad_strip_v2 *wp_tablet_pad_strip)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad group handle strip, pad group = %p, strip = %p",
wp_tablet_pad_group, wp_tablet_pad_strip));
uint32_t modes)
{
GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad group handle modes, pad group = %p, n_modes = %d",
wp_tablet_pad_group, modes));
tablet_pad_group_handle_done (void *data,
struct zwp_tablet_pad_group_v2 *wp_tablet_pad_group)
{
- GDK_NOTE (EVENTS,
+ GdkWaylandTabletPadGroupData *group = data;
+ GdkWaylandTabletPadData *pad = group->pad;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
+
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad group handle done, pad group = %p",
wp_tablet_pad_group));
}
GdkEvent *event;
guint n_group;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad group handle mode, pad group = %p, mode = %d",
wp_tablet_pad_group, mode));
{
GdkWaylandTabletPadData *pad = data;
GdkWaylandTabletPadGroupData *group;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad handle group, pad group = %p, group = %p",
wp_tablet_pad_group, wp_tablet_pad_group));
const char *path)
{
GdkWaylandTabletPadData *pad = data;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad handle path, pad = %p, path = %s",
wp_tablet_pad, path));
uint32_t buttons)
{
GdkWaylandTabletPadData *pad = data;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad handle buttons, pad = %p, n_buttons = %d",
wp_tablet_pad, buttons));
GdkWaylandTabletPadData *pad = data;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad handle done, pad = %p", wp_tablet_pad));
pad->device =
GdkEvent *event;
gint n_group;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad handle button, pad = %p, button = %d, state = %d",
wp_tablet_pad, button, state));
struct wl_surface *surface)
{
GdkWaylandTabletPadData *pad = data;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad handle enter, pad = %p, tablet = %p surface = %p",
wp_tablet_pad, wp_tablet, surface));
struct wl_surface *surface)
{
GdkWaylandTabletPadData *pad = data;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad handle leave, pad = %p, surface = %p",
wp_tablet_pad, surface));
struct zwp_tablet_pad_v2 *wp_tablet_pad)
{
GdkWaylandTabletPadData *pad = data;
+ GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("tablet pad handle removed, pad = %p", wp_tablet_pad));
/* Remove from the current tablet */
{
GdkWaylandSeat *seat = data;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("pointer surface of seat %p entered output %p",
seat, output));
{
GdkWaylandSeat *seat = data;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("pointer surface of seat %p left output %p",
seat, output));
_gdk_wayland_display_update_serial (display_wayland, serial);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (GDK_DISPLAY (data), EVENTS,
g_message ("ping, shell %p, serial %u\n", xdg_shell, serial));
zxdg_shell_v6_pong (xdg_shell, serial);
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_drag_context_read_async);
- GDK_NOTE (DND, char *s = gdk_content_formats_to_string (formats);
+ GDK_DISPLAY_NOTE (display, DND, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: read for %s\n", context, s);
g_free (s); );
dnd_formats = gdk_wayland_selection_get_targets (display);
gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
forward_bit = gdk_gl_context_get_forward_compatible (context);
- legacy_bit = GDK_DEBUG_CHECK (GL_LEGACY) ||
+ legacy_bit = GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
(share != NULL && gdk_gl_context_is_legacy (share));
- use_es = GDK_DEBUG_CHECK (GL_GLES) ||
+ use_es = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES) ||
(share != NULL && gdk_gl_context_get_use_es (share));
flags = 0;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
- GDK_NOTE (OPENGL, g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
+ GDK_DISPLAY_NOTE (display, OPENGL,
+ g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
forward_bit ? "yes" : "no",
legacy_bit = TRUE;
use_es = FALSE;
- GDK_NOTE (OPENGL, g_message ("eglCreateContext failed, switching to legacy"));
+ GDK_DISPLAY_NOTE (display, OPENGL,
+ g_message ("eglCreateContext failed, switching to legacy"));
ctx = eglCreateContext (display_wayland->egl_display,
context_wayland->egl_config,
share != NULL ? GDK_WAYLAND_GL_CONTEXT (share)->egl_context
return FALSE;
}
- GDK_NOTE (OPENGL, g_message ("Created EGL context[%p]", ctx));
+ GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
context_wayland->egl_context = ctx;
display_wayland->have_egl_surfaceless_context =
epoxy_has_egl_extension (dpy, "EGL_KHR_surfaceless_context");
- GDK_NOTE (OPENGL,
+ GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("EGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Version: %s\n"
eglMakeCurrent(display_wayland->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
- GDK_NOTE (OPENGL, g_message ("Destroying EGL context"));
+ GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Destroying EGL context"));
eglDestroyContext (display_wayland->egl_display,
context_wayland->egl_context);
return;
}
- GDK_NOTE(INPUT, g_print ("keymap:\n%s\n", map_str));
+ GDK_DISPLAY_NOTE (keymap->display, INPUT, g_print ("keymap:\n%s\n", map_str));
xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
munmap (map_str, size);
return;
}
- GDK_NOTE(INPUT, print_modifiers (xkb_keymap));
+ GDK_DISPLAY_NOTE (keymap->display, INPUT, print_modifiers (xkb_keymap));
xkb_keymap_unref (keymap_wayland->xkb_keymap);
keymap_wayland->xkb_keymap = xkb_keymap;
if (cb->source)
{
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, g_printerr ("%p: Ignoring clipboard offer for self\n", cb));
gdk_content_formats_unref (formats);
return;
}
gdk_wayland_primary_discard_offer (cb);
- GDK_NOTE (CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: remote clipboard claim for %s\n", cb, s);
g_free (s); );
cb->offer_formats = formats;
if (cb->pending != offer)
{
- GDK_NOTE (SELECTION, g_printerr ("%p: offer for unknown selection %p of %s\n",
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: offer for unknown selection %p of %s\n",
cb, offer, type));
return;
}
{
GdkWaylandPrimary *cb = data;
- GDK_NOTE (SELECTION, g_printerr ("%p: new primary offer %p\n",
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: new primary offer %p\n",
cb, offer));
gdk_wayland_primary_discard_pending (cb);
if (cb->pending != offer)
{
- GDK_NOTE (SELECTION, g_printerr ("%p: ignoring unknown data offer %p\n",
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), SELECTION, g_printerr ("%p: ignoring unknown data offer %p\n",
cb, offer));
return;
}
if (!gdk_clipboard_write_finish (GDK_CLIPBOARD (clipboard), result, &error))
{
- GDK_NOTE (SELECTION, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard)), SELECTION, g_printerr ("%p: failed to write stream: %s\n", clipboard, error->message));
g_error_free (error);
}
}
GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (data);
GOutputStream *stream;
- GDK_NOTE (SELECTION, g_printerr ("%p: data source send request for %s on fd %d\n",
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), SELECTION, g_printerr ("%p: data source send request for %s on fd %d\n",
source, mime_type, fd));
mime_type = gdk_intern_mime_type (mime_type);
{
GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (data);
- GDK_NOTE (CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (data)), CLIPBOARD, g_printerr ("%p: data source cancelled\n", data));
if (cb->source == source)
{
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_primary_read_async);
- GDK_NOTE (CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (clipboard), CLIPBOARD, char *s = gdk_content_formats_to_string (formats);
g_printerr ("%p: read for %s\n", cb, s);
g_free (s); );
mime_type = gdk_content_formats_match_mime_type (formats, cb->offer_formats);
drop_context->actions = _wl_to_gdk_actions (source_actions);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("data offer source actions, offer %p, actions %d", wl_data_offer, source_actions));
if (gdk_drag_context_get_dest_window (drop_context))
if (!gdk_drag_context_write_finish (GDK_DRAG_CONTEXT (context), result, &error))
{
- GDK_NOTE(DND, g_printerr ("%p: failed to write stream: %s\n", context, error->message));
+ GDK_DISPLAY_NOTE (gdk_drag_context_get_display (GDK_DRAG_CONTEXT (context)), DND, g_printerr ("%p: failed to write stream: %s\n", context, error->message));
g_error_free (error);
}
}
if (!context)
return;
- GDK_NOTE (DND, g_printerr ("%p: data source send request for %s on fd %d\n",
+ GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND, g_printerr ("%p: data source send request for %s on fd %d\n",
source, mime_type, fd));
//mime_type = gdk_intern_mime_type (mime_type);
GdkDragContext *context;
GdkDisplay *display;
- GDK_NOTE (EVENTS,
- g_message ("data source cancelled, source = %p", source));
-
display = gdk_display_get_default ();
+ GDK_DISPLAY_NOTE (display, EVENTS,
+ g_message ("data source cancelled, source = %p", source));
+
if (source != wayland_selection->dnd_source)
return;
{
GdkDragContext *context;
- GDK_NOTE (EVENTS,
- g_message ("data source action, source = %p action=%x",
- source, action));
-
context = gdk_wayland_drag_context_lookup_by_data_source (source);
-
if (!context)
return;
+ GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), EVENTS,
+ g_message ("data source action, source = %p action=%x",
+ source, action));
+
context->action = _wl_to_gdk_actions (action);
g_signal_emit_by_name (context, "action-changed", context->action);
}
GdkFrameClock *clock = gdk_window_get_frame_clock (window);
GdkFrameTimings *timings;
- GDK_NOTE (EVENTS,
- g_message ("frame %p", window));
+ GDK_DISPLAY_NOTE (GDK_DISPLAY (display_wayland), EVENTS, g_message ("frame %p", window));
wl_callback_destroy (callback);
GdkWindow *window = GDK_WINDOW (data);
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS,
g_message ("surface enter, window %p output %p", window, output));
impl->display_server.outputs = g_slist_prepend (impl->display_server.outputs, output);
GdkWindow *window = GDK_WINDOW (data);
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS,
g_message ("surface leave, window %p output %p", window, output));
impl->display_server.outputs = g_slist_remove (impl->display_server.outputs, output);
gdk_wayland_window_configure (window, width, height, impl->scale);
}
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS,
g_message ("configure, window %p %dx%d,%s%s%s%s",
window, width, height,
(new_state & GDK_WINDOW_STATE_FULLSCREEN) ? " fullscreen" : "",
GdkDisplay *display;
GdkEvent *event;
- GDK_NOTE (EVENTS,
- g_message ("close %p", window));
+ display = gdk_window_get_display (window);
+
+ GDK_DISPLAY_NOTE (display, EVENTS, g_message ("close %p", window));
event = gdk_event_new (GDK_DELETE);
event->any.window = g_object_ref (window);
event->any.send_event = TRUE;
- display = gdk_window_get_display (window);
_gdk_wayland_display_deliver_event (display, event);
}
{
GdkWindow *window = GDK_WINDOW (data);
- GDK_NOTE (EVENTS,
- g_message ("done %p", window));
+ GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS, g_message ("done %p", window));
gdk_window_hide (window);
}
const Atom *atoms,
gsize n_atoms)
{
- GDK_NOTE(CLIPBOARD,
- GdkDisplay *display = gdk_clipboard_get_display (GDK_CLIPBOARD (cb));
- gsize i;
-
- g_printerr ("%s: %s [ ", cb->selection, prefix);
- for (i = 0; i < n_atoms; i++)
- {
- g_printerr ("%s%s", i > 0 ? ", " : "", gdk_x11_get_xatom_name_for_display (display , atoms[i]));
- }
- g_printerr (" ]\n");
- );
+ GdkDisplay *display = gdk_clipboard_get_display (GDK_CLIPBOARD (cb));
+
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ gsize i;
+
+ g_printerr ("%s: %s [ ", cb->selection, prefix);
+ for (i = 0; i < n_atoms; i++)
+ g_printerr ("%s%s", i > 0 ? ", " : "", gdk_x11_get_xatom_name_for_display (display , atoms[i]));
+ g_printerr (" ]\n");
+ );
}
static void
if (!gdk_clipboard_write_finish (GDK_CLIPBOARD (clipboard), result, &error))
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: failed to write stream: %s\n", GDK_X11_CLIPBOARD (clipboard)->selection, error->message));
+ GdkDisplay *display = gdk_clipboard_get_display (GDK_CLIPBOARD (clipboard));
+
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: failed to write stream: %s\n",
+ GDK_X11_CLIPBOARD (clipboard)->selection, error->message));
g_error_free (error);
}
}
bytes = g_input_stream_read_bytes_finish (stream, res, &error);
if (bytes == NULL)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: error reading TARGETS: %s\n", cb->selection, error->message));
+ GdkDisplay *display = gdk_clipboard_get_display (GDK_CLIPBOARD (cb));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: error reading TARGETS: %s\n", cb->selection, error->message));
g_error_free (error);
g_object_unref (stream);
g_object_unref (cb);
formats = gdk_x11_clipboard_formats_from_atoms (display,
g_bytes_get_data (bytes, NULL),
g_bytes_get_size (bytes) / sizeof (Atom));
- GDK_NOTE(CLIPBOARD, char *s = gdk_content_formats_to_string (formats); g_printerr ("%s: got formats: %s\n", cb->selection, s); g_free (s));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, char *s = gdk_content_formats_to_string (formats); g_printerr ("%s: got formats: %s\n", cb->selection, s); g_free (s));
/* union with previously loaded formats */
formats = gdk_content_formats_union (formats, gdk_clipboard_get_formats (GDK_CLIPBOARD (cb)));
const char *type;
int format;
+ display = gdk_clipboard_get_display (GDK_CLIPBOARD (cb));
stream = gdk_x11_selection_input_stream_new_finish (result, &type, &format, &error);
if (stream == NULL)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: can't request TARGETS: %s\n", cb->selection, error->message));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: can't request TARGETS: %s\n", cb->selection, error->message));
g_object_unref (cb);
g_error_free (error);
return;
}
else if (!g_str_equal (type, "ATOM") || format != 32)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: Wrong reply type to TARGETS: type %s != ATOM or format %d != 32\n",
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: Wrong reply type to TARGETS: type %s != ATOM or format %d != 32\n",
cb->selection, type, format));
g_input_stream_close (stream, NULL, NULL);
g_object_unref (stream);
return;
}
- display = gdk_clipboard_get_display (GDK_CLIPBOARD (cb));
-
g_input_stream_read_bytes_async (stream,
gdk_x11_display_get_max_request_size (display),
G_PRIORITY_DEFAULT,
if (xevent->xselectionclear.time < cb->timestamp)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: ignoring SelectionClear with too old timestamp (%lu vs %lu)\n",
- cb->selection, xevent->xselectionclear.time, cb->timestamp));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: ignoring SelectionClear with too old timestamp (%lu vs %lu)\n",
+ cb->selection, xevent->xselectionclear.time, cb->timestamp));
return FALSE;
}
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: got SelectionClear\n", cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: got SelectionClear\n", cb->selection));
gdk_x11_clipboard_claim_remote (cb, xevent->xselectionclear.time);
return TRUE;
/* We already received a selectionNotify before */
if (cb->store_task == NULL)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: got SelectionNotify for nonexisting task?!\n",
- cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: got SelectionNotify for nonexisting task?!\n", cb->selection));
return FALSE;
}
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: got SelectionNotify for store task\n",
- cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: got SelectionNotify for store task\n", cb->selection));
if (xevent->xselection.property != None)
g_task_return_boolean (cb->store_task, TRUE);
if (!gdk_clipboard_is_local (GDK_CLIPBOARD (cb)))
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: got SelectionRequest for %s @ %s even though we don't own the selection, huh?\n",
- cb->selection, target, property));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: got SelectionRequest for %s @ %s even though we don't own the selection, huh?\n",
+ cb->selection, target, property));
return TRUE;
}
if (xevent->xselectionrequest.requestor == None)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: got SelectionRequest for %s @ %s with NULL window, ignoring\n",
- cb->selection, target, property));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: got SelectionRequest for %s @ %s with NULL window, ignoring\n",
+ cb->selection, target, property));
return TRUE;
}
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: got SelectionRequest for %s @ %s\n",
- cb->selection, target, property));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: got SelectionRequest for %s @ %s\n", cb->selection, target, property));
gdk_x11_selection_output_streams_create (display,
gdk_clipboard_get_formats (GDK_CLIPBOARD (cb)),
if (sn->owner == GDK_X11_DISPLAY (display)->leader_window)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: Ignoring XFixesSelectionNotify for ourselves\n",
- cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: Ignoring XFixesSelectionNotify for ourselves\n", cb->selection));
return FALSE;
}
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: Received XFixesSelectionNotify, claiming selection\n",
- cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: Received XFixesSelectionNotify, claiming selection\n", cb->selection));
gdk_x11_clipboard_claim_remote (cb, sn->selection_timestamp);
}
if (XGetSelectionOwner (xdisplay, cb->xselection) != xwindow)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: failed XSetSelectionOwner()\n", cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: failed XSetSelectionOwner()\n", cb->selection));
return FALSE;
}
}
}
cb->timestamp = time;
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: claimed via XSetSelectionOwner()\n", cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: claimed via XSetSelectionOwner()\n", cb->selection));
}
return GDK_CLIPBOARD_CLASS (gdk_x11_clipboard_parent_class)->claim (clipboard, formats, local, content);
/* clipboard managers don't work on anythig but the clipbpoard selection */
if (!g_str_equal (cb->selection, "CLIPBOARD"))
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: can only store on CLIPBOARD\n",
- cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: can only store on CLIPBOARD\n", cb->selection));
GDK_CLIPBOARD_CLASS (gdk_x11_clipboard_parent_class)->store_async (clipboard,
io_priority,
cancellable,
if (XGetSelectionOwner (xdisplay, clipboard_manager) == None)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: XGetSelectionOwner (CLIPBOARD_MANAGER) returned None, aborting.\n",
- cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: XGetSelectionOwner (CLIPBOARD_MANAGER) returned None, aborting.\n",
+ cb->selection));
g_task_return_new_error (cb->store_task, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Cannot store clipboard. No clipboard manager is active."));
g_clear_object (&cb->store_task);
content = gdk_clipboard_get_content (clipboard);
if (content == NULL)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: storing empty clipboard: SUCCESS!\n",
- cb->selection));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: storing empty clipboard: SUCCESS!\n", cb->selection));
g_task_return_boolean (cb->store_task, TRUE);
g_clear_object (&cb->store_task);
return;
error = gdk_x11_display_error_trap_pop (display);
if (error != Success)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: X error during ConvertSelection() while storing selection: %d\n",
- cb->selection, error));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
+ g_printerr ("%s: X error during ConvertSelection() while storing selection: %d\n", cb->selection, error));
}
}
{
GdkX11Clipboard *cb = GDK_X11_CLIPBOARD (g_task_get_source_object (task));
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: reading %s failed, trying %s next\n",
- cb->selection, (char *) targets->data, (char *) next->data));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD(cb)), CLIPBOARD,
+ g_printerr ("%s: reading %s failed, trying %s next\n",
+ cb->selection, (char *) targets->data, (char *) next->data));
targets->next = NULL;
g_task_set_task_data (task, next, (GDestroyNotify) g_slist_free);
gdk_x11_selection_input_stream_new_async (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)),
{
g_assert (special_targets[i].mime_type != NULL);
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: reading with converter from %s to %s\n",
- cb->selection, mime_type, special_targets[i].mime_type));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD,
+ g_printerr ("%s: reading with converter from %s to %s\n",
+ cb->selection, mime_type, special_targets[i].mime_type));
mime_type = g_intern_string (special_targets[i].mime_type);
g_task_set_task_data (task, g_slist_prepend (NULL, (gpointer) mime_type), (GDestroyNotify) g_slist_free);
stream = special_targets[i].convert (cb, stream, type, format);
}
}
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: reading clipboard as %s now\n",
- cb->selection, mime_type));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD,
+ g_printerr ("%s: reading clipboard as %s now\n", cb->selection, mime_type));
g_task_return_pointer (task, stream, g_object_unref);
}
return;
}
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: new read for %s (%u other options)\n",
- cb->selection, (char *) targets->data, g_slist_length (targets->next)));
+ GDK_DISPLAY_NOTE (gdk_clipboard_get_display (clipboard), CLIPBOARD,
+ g_printerr ("%s: new read for %s (%u other options)\n",
+ cb->selection, (char *) targets->data, g_slist_length (targets->next)));
gdk_x11_selection_input_stream_new_async (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)),
cb->selection,
targets->data,
xconfine_to = GDK_WINDOW_XID (confine_to);
#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (NOGRABS))
+ if (GDK_DISPLAY_DEBUG_CHECK (display, NOGRABS))
status = GrabSuccess;
else
#endif
event_mask,
&mask.mask_len);
-#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (NOGRABS))
+#if G_ENABLE_DEBUG
+ if (GDK_DISPLAY_DEBUG_CHECK (display, NOGRABS))
status = GrabSuccess;
else
#endif
- status = XIGrabDevice (GDK_DISPLAY_XDISPLAY (display),
- device_xi2->device_id,
- xwindow,
- time_,
- xcursor,
- GrabModeAsync, GrabModeAsync,
- owner_events,
- &mask);
+ status = XIGrabDevice (GDK_DISPLAY_XDISPLAY (display),
+ device_xi2->device_id,
+ xwindow,
+ time_,
+ xcursor,
+ GrabModeAsync, GrabModeAsync,
+ owner_events,
+ &mask);
g_free (mask.mask);
_gdk_x11_event_translate_keyboard_string (&event->key);
#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (EVENTS))
+ if (GDK_DISPLAY_DEBUG_CHECK (display, EVENTS))
{
g_message ("%s:\t\twindow: %ld key: %12s %d",
event->any.type == GDK_KEY_PRESS ? "key press " : "key release",
break;
case ButtonPress:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("button press:\t\twindow: %ld x,y: %d %d button: %d",
xevent->xbutton.window,
xevent->xbutton.x, xevent->xbutton.y,
break;
case ButtonRelease:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("button release:\twindow: %ld x,y: %d %d button: %d",
xevent->xbutton.window,
xevent->xbutton.x, xevent->xbutton.y,
break;
case MotionNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("motion notify:\t\twindow: %ld x,y: %d %d hint: %s",
xevent->xmotion.window,
xevent->xmotion.x, xevent->xmotion.y,
break;
case EnterNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("enter notify:\t\twindow: %ld detail: %d subwin: %ld",
xevent->xcrossing.window,
xevent->xcrossing.detail,
break;
case LeaveNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("leave notify:\t\twindow: %ld detail: %d subwin: %ld",
xevent->xcrossing.window,
xevent->xcrossing.detail, xevent->xcrossing.subwindow));
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (source_device == NULL || GDK_IS_DEVICE (source_device));
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS,
g_message ("focus out:\t\twindow: %ld, detail: %s, mode: %s",
GDK_WINDOW_XID (window),
notify_details[detail],
{
GdkX11DeviceManagerXI2 *device_manager_xi2;
- GDK_NOTE (INPUT, g_message ("Creating XI2 device manager"));
+ GDK_DISPLAY_NOTE (display, INPUT, g_message ("Creating XI2 device manager"));
device_manager_xi2 = g_object_new (GDK_TYPE_X11_DEVICE_MANAGER_XI2,
"display", display,
#endif /* XINPUT_2 */
}
- GDK_NOTE (INPUT, g_message ("Creating core device manager"));
+ GDK_DISPLAY_NOTE (display, INPUT, g_message ("Creating core device manager"));
return g_object_new (GDK_TYPE_X11_DEVICE_MANAGER_CORE,
"display", display,
label = NULL;
_gdk_device_add_axis (device, label, use, min, max, resolution);
- GDK_NOTE (INPUT, g_message ("\n\taxis: %s %s", (const char *)label, use == GDK_AXIS_IGNORE ? "(ignored)" : "(used)"));
+ GDK_DISPLAY_NOTE (display, INPUT, g_message ("\n\taxis: %s %s", (const char *)label, use == GDK_AXIS_IGNORE ? "(ignored)" : "(used)"));
}
static void
else
direction = GDK_SCROLL_RIGHT;
- GDK_NOTE (INPUT,
+ GDK_DISPLAY_NOTE (display, INPUT,
g_message ("\n\tscroll valuator %d: %s, increment %f",
scroll_info->number,
scroll_info->scroll_type == XIScrollTypeVertical
break;
}
- GDK_NOTE (INPUT,
+ GDK_DISPLAY_NOTE (display, INPUT,
({
const gchar *type_names[] = { "master", "slave", "floating" };
const gchar *source_names[] = { "mouse", "pen", "eraser", "cursor", "keyboard", "direct touch", "indirect touch", "trackpoint", "pad" };
GdkKeymap *keymap = gdk_display_get_keymap (display);
GdkModifierType consumed, state;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("key %s:\twindow %ld\n"
"\tdevice:%u\n"
"\tsource device:%u\n"
{
XIDeviceEvent *xev = (XIDeviceEvent *) ev;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("button %s:\twindow %ld\n"
"\tdevice:%u\n"
"\tsource device:%u\n"
if (delta_x == 0.0 && delta_y == 0.0)
event->scroll.is_stop = TRUE;
- GDK_NOTE(EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("smooth scroll: \n\tdevice: %u\n\tsource device: %u\n\twindow %ld\n\tdeltas: %f %f",
xev->deviceid, xev->sourceid,
xev->event, delta_x, delta_y));
{
XIDeviceEvent *xev = (XIDeviceEvent *) ev;
- GDK_NOTE(EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("touch %s:\twindow %ld\n\ttouch id: %u\n\tpointer emulating: %s",
ev->evtype == XI_TouchBegin ? "begin" : "end",
xev->event,
{
XIDeviceEvent *xev = (XIDeviceEvent *) ev;
- GDK_NOTE(EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("touch update:\twindow %ld\n\ttouch id: %u\n\tpointer emulating: %s",
xev->event,
xev->detail,
{
XIEnterEvent *xev = (XIEnterEvent *) ev;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("%s notify:\twindow %ld\n\tsubwindow:%ld\n"
"\tdevice: %u\n\tsource device: %u\n"
"\tnotify type: %u\n\tcrossing mode: %u",
switch (xevent->type)
{
case KeymapNotify:
- GDK_NOTE (EVENTS,
- g_message ("keymap notify"));
+ GDK_DISPLAY_NOTE (display, EVENTS, g_message ("keymap notify"));
/* Not currently handled */
return_val = FALSE;
break;
case Expose:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d%s",
xevent->xexpose.window, xevent->xexpose.count,
xevent->xexpose.x, xevent->xexpose.y,
GdkRectangle expose_rect;
int x2, y2;
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("graphics expose:\tdrawable: %ld",
xevent->xgraphicsexpose.drawable));
case VisibilityNotify:
#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (EVENTS))
+ if (GDK_DISPLAY_DEBUG_CHECK (display, EVENTS))
switch (xevent->xvisibility.state)
{
case VisibilityFullyObscured:
break;
case CreateNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("create notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d parent: %ld ovr: %d",
xevent->xcreatewindow.window,
xevent->xcreatewindow.x,
break;
case DestroyNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("destroy notify:\twindow: %ld",
xevent->xdestroywindow.window));
break;
case UnmapNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("unmap notify:\t\twindow: %ld",
xevent->xmap.window));
break;
case MapNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("map notify:\t\twindow: %ld",
xevent->xmap.window));
break;
case ReparentNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("reparent notify:\twindow: %ld x,y: %d %d parent: %ld ovr: %d",
xevent->xreparent.window,
xevent->xreparent.x,
break;
case ConfigureNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s",
xevent->xconfigure.window,
xevent->xconfigure.x,
break;
case PropertyNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s",
xevent->xproperty.window,
xevent->xproperty.atom,
break;
case ColormapNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("colormap notify:\twindow: %ld",
xevent->xcolormap.window));
break;
case ClientMessage:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("client message:\twindow: %ld",
xevent->xclient.window));
break;
case MappingNotify:
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("mapping notify"));
/* Let XLib know that there is a new keyboard mapping.
timings->complete = TRUE;
#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (FRAMES))
+ if (GDK_DISPLAY_DEBUG_CHECK (display, FRAMES))
_gdk_frame_clock_debug_print_timings (clock, timings);
#endif /* G_ENABLE_DEBUG */
}
* the event is passed along to the program,
* which should then destroy the window.
*/
- GDK_NOTE (EVENTS,
+ GDK_DISPLAY_NOTE (display, EVENTS,
g_message ("delete window:\t\twindow: %ld",
xevent->xclient.window));
{
GdkDragContext *context = GDK_DRAG_CONTEXT (g_task_get_source_object (task));
- GDK_NOTE (DND, g_printerr ("reading %s failed, trying %s next\n",
+ GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND, g_printerr ("reading %s failed, trying %s next\n",
(char *) targets->data, (char *) next->data));
targets->next = NULL;
g_task_set_task_data (task, next, (GDestroyNotify) g_slist_free);
{
g_assert (special_targets[i].mime_type != NULL);
- GDK_NOTE(CLIPBOARD, g_printerr ("%s: reading with converter from %s to %s\n",
+ GDK_DISPLAY_NOTE (CLIPBOARD, g_printerr ("%s: reading with converter from %s to %s\n",
cb->selection, mime_type, special_targets[i].mime_type));
mime_type = g_intern_string (special_targets[i].mime_type);
g_task_set_task_data (task, g_slist_prepend (NULL, (gpointer) mime_type), (GDestroyNotify) g_slist_free);
}
#endif
- GDK_NOTE(DND, g_printerr ("reading DND as %s now\n",
+ GDK_NOTE (DND, g_printerr ("reading DND as %s now\n",
mime_type));
g_task_return_pointer (task, stream, g_object_unref);
}
return;
}
- GDK_NOTE(DND, g_printerr ("new read for %s (%u other options)\n",
+ GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND, g_printerr ("new read for %s (%u other options)\n",
(char *) targets->data, g_slist_length (targets->next)));
gdk_x11_selection_input_stream_new_async (gdk_drag_context_get_display (context),
"XdndSelection",
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- GDK_NOTE (DND,
- g_message ("XdndStatus: dest_window: %#x action: %ld",
- dest_window, action));
-
display = gdk_window_get_display (event->any.window);
context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window);
+ GDK_DISPLAY_NOTE (display, DND,
+ g_message ("XdndStatus: dest_window: %#x action: %ld",
+ dest_window, action));
+
if (context)
{
GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context);
if (!(action != 0) != !(flags & 1))
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_warning ("Received status event with flags not corresponding to action!"));
action = 0;
}
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- GDK_NOTE (DND,
- g_message ("XdndFinished: dest_window: %#x", dest_window));
-
display = gdk_window_get_display (event->any.window);
context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window);
+ GDK_DISPLAY_NOTE (display, DND,
+ g_message ("XdndFinished: dest_window: %#x", dest_window));
+
if (context)
{
g_object_ref (context);
gpointer data)
{
GdkDragContext *context = data;
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND,
g_message ("Got async callback for #%lx, success = %d",
window, success));
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- GDK_NOTE(DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_message ("Sending enter source window %#lx XDND protocol version %d\n",
GDK_WINDOW_XID (context_x11->ipc_window), context_x11->version));
atoms = gdk_content_formats_get_mime_types (context->formats, &n_atoms);
if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev))
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window);
if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev))
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window);
if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev))
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window);
if (!xdnd_send_xevent (context_x11, context->dest_window, FALSE, &xev))
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->dest_window)));
g_object_unref (context->dest_window);
}
else
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_warning ("Invalid XdndProxy property on window %ld", win));
}
}
else
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_warning ("Invalid XdndAware property on window %ld", win));
}
context_x11->xdnd_have_actions = TRUE;
#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (DND))
+ if (GDK_DISPLAY_DEBUG_CHECK (display, DND))
{
GString *action_str = g_string_new (NULL);
if (context->actions & GDK_ACTION_MOVE)
xdnd_precache_atoms (display);
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_message ("XdndEnter: source_window: %#x, version: %#x",
source_window, version));
if (version < 3)
{
/* Old source ignore */
- GDK_NOTE (DND, g_message ("Ignored old XdndEnter message"));
+ GDK_DISPLAY_NOTE (display, DND, g_message ("Ignored old XdndEnter message"));
return GDK_FILTER_REMOVE;
}
g_ptr_array_unref (formats);
#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (DND))
+ if (GDK_DISPLAY_DEBUG_CHECK (display, DND))
print_target_list (context->formats);
#endif /* G_ENABLE_DEBUG */
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- GDK_NOTE (DND,
- g_message ("XdndLeave: source_window: %#x",
- source_window));
-
display = GDK_WINDOW_DISPLAY (event->any.window);
display_x11 = GDK_X11_DISPLAY (display);
+ GDK_DISPLAY_NOTE (display, DND,
+ g_message ("XdndLeave: source_window: %#x",
+ source_window));
+
xdnd_precache_atoms (display);
if ((display_x11->current_dest_drag != NULL) &&
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- GDK_NOTE (DND,
- g_message ("XdndPosition: source_window: %#x position: (%d, %d) time: %d action: %ld",
- source_window, x_root, y_root, time, action));
-
display = GDK_WINDOW_DISPLAY (event->any.window);
display_x11 = GDK_X11_DISPLAY (display);
+ GDK_DISPLAY_NOTE (display, DND,
+ g_message ("XdndPosition: source_window: %#x position: (%d, %d) time: %d action: %ld",
+ source_window, x_root, y_root, time, action));
+
xdnd_precache_atoms (display);
context = display_x11->current_dest_drag;
gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN)
return GDK_FILTER_CONTINUE; /* Not for us */
- GDK_NOTE (DND,
- g_message ("XdndDrop: source_window: %#x time: %d",
- source_window, time));
-
display = GDK_WINDOW_DISPLAY (event->any.window);
display_x11 = GDK_X11_DISPLAY (display);
+ GDK_DISPLAY_NOTE (display, DND,
+ g_message ("XdndDrop: source_window: %#x time: %d",
+ source_window, time));
+
xdnd_precache_atoms (display);
context = display_x11->current_dest_drag;
*protocol = GDK_DRAG_PROTO_XDND;
*version = 5;
xdnd_precache_atoms (display);
- GDK_NOTE (DND, g_message ("Entering local Xdnd window %#x\n", (guint) xid));
+ GDK_DISPLAY_NOTE (display, DND, g_message ("Entering local Xdnd window %#x\n", (guint) xid));
return xid;
}
else if (_gdk_x11_display_is_root_window (display, xid))
{
*protocol = GDK_DRAG_PROTO_ROOTWIN;
- GDK_NOTE (DND, g_message ("Entering root window\n"));
+ GDK_DISPLAY_NOTE (display, DND, g_message ("Entering root window\n"));
return xid;
}
}
{
*protocol = GDK_DRAG_PROTO_XDND;
xdnd_precache_atoms (display);
- GDK_NOTE (DND, g_message ("Entering Xdnd window %#x\n", (guint) xid));
+ GDK_DISPLAY_NOTE (display, DND, g_message ("Entering Xdnd window %#x\n", (guint) xid));
return retval;
}
else
if (rootwin)
{
- GDK_NOTE (DND, g_message ("Entering root window\n"));
+ GDK_DISPLAY_NOTE (display, DND, g_message ("Entering root window\n"));
*protocol = GDK_DRAG_PROTO_ROOTWIN;
return xid;
}
xev.xclient.data.l[4] = xdnd_action_to_atom (display, action);
if (!xdnd_send_xevent (context_x11, context->source_window, FALSE, &xev))
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->source_window)));
}
if (!xdnd_send_xevent (GDK_X11_DRAG_CONTEXT (context), context->source_window, FALSE, &xev))
{
- GDK_NOTE (DND,
+ GDK_DISPLAY_NOTE (display, DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XID (context->source_window)));
}
if (!gdk_drag_context_write_finish (GDK_DRAG_CONTEXT (context), result, &error))
{
- GDK_NOTE(DND, g_printerr ("failed to write stream: %s\n", error->message));
+ GDK_DISPLAY_NOTE (gdk_drag_context_get_display (GDK_DRAG_CONTEXT (context)), DND, g_printerr ("failed to write stream: %s\n", error->message));
g_error_free (error);
}
}
if (xevent->xselectionclear.time < x11_context->timestamp)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("ignoring SelectionClear with too old timestamp (%lu vs %lu)\n",
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("ignoring SelectionClear with too old timestamp (%lu vs %lu)\n",
xevent->xselectionclear.time, x11_context->timestamp));
return FALSE;
}
- GDK_NOTE(CLIPBOARD, g_printerr ("got SelectionClear, aborting DND\n"));
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("got SelectionClear, aborting DND\n"));
gdk_drag_context_cancel (context, GDK_DRAG_CANCEL_ERROR);
return TRUE;
if (xevent->xselectionrequest.requestor == None)
{
- GDK_NOTE(CLIPBOARD, g_printerr ("got SelectionRequest for %s @ %s with NULL window, ignoring\n",
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("got SelectionRequest for %s @ %s with NULL window, ignoring\n",
target, property));
return TRUE;
}
- GDK_NOTE(CLIPBOARD, g_printerr ("got SelectionRequest for %s @ %s\n",
+ GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("got SelectionRequest for %s @ %s\n",
target, property));
gdk_x11_selection_output_streams_create (display,
x11_context->timestamp);
if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), xselection) != GDK_WINDOW_XID (x11_context->ipc_window))
{
- GDK_NOTE(DND, g_printerr ("failed XSetSelectionOwner() on \"XdndSelection\", aborting DND\n"));
+ GDK_DISPLAY_NOTE (display, DND, g_printerr ("failed XSetSelectionOwner() on \"XdndSelection\", aborting DND\n"));
g_object_unref (context);
return NULL;
}
drawable = context_x11->attached_drawable;
- GDK_NOTE (OPENGL,
+ GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Flushing GLX buffers for drawable %lu (window: %lu), frame sync: %s",
(unsigned long) drawable,
(unsigned long) gdk_x11_window_get_xid (window),
if (glx_pixmap == NULL)
return FALSE;
- GDK_NOTE (OPENGL, g_message ("Using GLX_EXT_texture_from_pixmap to draw surface"));
+ GDK_DISPLAY_NOTE (GDK_DISPLAY (display_x11), OPENGL, g_message ("Using GLX_EXT_texture_from_pixmap to draw surface"));
window = gdk_gl_context_get_window (paint_context)->impl_window;
window_scale = gdk_window_get_scale_factor (window);
compat_bit = gdk_gl_context_get_forward_compatible (context);
/* If there is no glXCreateContextAttribsARB() then we default to legacy */
- legacy_bit = !display_x11->has_glx_create_context || GDK_DEBUG_CHECK (GL_LEGACY);
+ legacy_bit = !display_x11->has_glx_create_context || GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY);
- es_bit = (GDK_DEBUG_CHECK (GL_GLES) || (share != NULL && gdk_gl_context_get_use_es (share))) &&
+ es_bit = (GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES) || (share != NULL && gdk_gl_context_get_use_es (share))) &&
(display_x11->has_glx_create_context && display_x11->has_glx_create_es2_context);
/* We cannot share legacy contexts with core profile ones, so the
if (compat_bit)
flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
- GDK_NOTE (OPENGL,
+ GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Creating GLX context (version:%d.%d, debug:%s, forward:%s, legacy:%s, es:%s)",
major, minor,
debug_bit ? "yes" : "no",
*/
if (legacy_bit && !GDK_X11_DISPLAY (display)->has_glx_create_context)
{
- GDK_NOTE (OPENGL, g_message ("Creating legacy GL context on request"));
+ GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating legacy GL context on request"));
context_x11->glx_context = create_legacy_context (display, context_x11->glx_config, share);
}
else
minor = 0;
}
- GDK_NOTE (OPENGL, g_message ("Creating GL3 context"));
+ GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating GL3 context"));
context_x11->glx_context = create_gl3_context (display,
context_x11->glx_config,
share,
/* Fall back to legacy in case the GL3 context creation failed */
if (context_x11->glx_context == NULL)
{
- GDK_NOTE (OPENGL, g_message ("Creating fallback legacy context"));
+ GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating fallback legacy context"));
context_x11->glx_context = create_legacy_context (display, context_x11->glx_config, share);
legacy_bit = TRUE;
es_bit = FALSE;
context_x11->is_direct = glXIsDirect (dpy, context_x11->glx_context);
- GDK_NOTE (OPENGL,
+ GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Realized GLX context[%p], %s",
context_x11->glx_context,
context_x11->is_direct ? "direct" : "indirect"));
if (glXGetCurrentContext () == context_x11->glx_context)
glXMakeContextCurrent (dpy, None, None, NULL);
- GDK_NOTE (OPENGL, g_message ("Destroying GLX context"));
+ GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Destroying GLX context"));
glXDestroyContext (dpy, context_x11->glx_context);
context_x11->glx_context = NULL;
}
if (display_x11->have_glx)
return TRUE;
- if (GDK_DEBUG_CHECK (GL_DISABLE))
+ if (GDK_DISPLAY_DEBUG_CHECK (display, GL_DISABLE))
return FALSE;
dpy = gdk_x11_display_get_xdisplay (display);
display_x11->has_glx_visual_rating =
epoxy_has_glx_extension (dpy, screen_num, "GLX_EXT_visual_rating");
- GDK_NOTE (OPENGL,
+ GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("GLX version %d.%d found\n"
" - Vendor: %s\n"
" - Checked extensions:\n"
else
drawable = context_x11->unattached_drawable;
- GDK_NOTE (OPENGL,
+ GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Making GLX context %p current to drawable %lu",
context, (unsigned long) drawable));
if (!glXMakeContextCurrent (dpy, drawable, drawable,
context_x11->glx_context))
{
- GDK_NOTE (OPENGL,
+ GDK_DISPLAY_NOTE (display, OPENGL,
g_message ("Making GLX context current failed"));
return FALSE;
}
return;
written = gdk_x11_selection_input_stream_fill_buffer (stream, priv->pending_data, priv->pending_size);
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: finishing read of %zd/%zu bytes\n",
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: finishing read of %zd/%zu bytes\n",
priv->selection, priv->target,
written, priv->pending_size));
g_task_return_int (priv->pending_task, written);
if (priv->complete)
return;
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: transfer complete\n",
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: transfer complete\n",
priv->selection, priv->target));
priv->complete = TRUE;
#endif
gssize written;
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: starting sync read of %zu bytes\n",
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: starting sync read of %zu bytes\n",
priv->selection, priv->target,
count));
written = gdk_x11_selection_input_stream_fill_buffer (stream, buffer, count);
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: finishing sync read of %zd/%zu bytes\n",
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: finishing sync read of %zd/%zu bytes\n",
priv->selection, priv->target,
written, count));
return written;
gssize size;
size = gdk_x11_selection_input_stream_fill_buffer (stream, buffer, count);
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: async read of %zd/%zu bytes\n",
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: async read of %zd/%zu bytes\n",
priv->selection, priv->target,
size, count));
g_task_return_int (task, size);
priv->pending_data = buffer;
priv->pending_size = count;
priv->pending_task = task;
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: async read of %zu bytes pending\n",
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: async read of %zu bytes pending\n",
priv->selection, priv->target,
count));
}
bytes = get_selection_property (xdisplay, xwindow, xevent->xproperty.atom, &type, &format);
if (bytes == NULL)
{
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: got PropertyNotify erroring out of INCR\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: got PropertyNotify erroring out of INCR\n",
priv->selection, priv->target));
/* error, should we signal one? */
gdk_x11_selection_input_stream_complete (stream);
}
else if (g_bytes_get_size (bytes) == 0 || type == None)
{
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: got PropertyNotify ending INCR\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: got PropertyNotify ending INCR\n",
priv->selection, priv->target));
g_bytes_unref (bytes);
gdk_x11_selection_input_stream_complete (stream);
}
else
{
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: got PropertyNotify during INCR with %zu bytes\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: got PropertyNotify during INCR with %zu bytes\n",
priv->selection, priv->target,
g_bytes_get_size (bytes)));
g_async_queue_push (priv->chunks, bytes);
g_task_get_source_tag (priv->pending_task) != gdk_x11_selection_input_stream_new_async)
return FALSE;
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: got SelectionNotify\n", priv->selection, priv->target));
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: got SelectionNotify\n", priv->selection, priv->target));
task = priv->pending_task;
priv->pending_task = NULL;
{
/* The remainder of the selection will come through PropertyNotify
events on xwindow */
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: initiating INCR transfer\n", priv->selection, priv->target));
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: initiating INCR transfer\n", priv->selection, priv->target));
priv->incr = TRUE;
gdk_x11_selection_input_stream_flush (stream);
}
else
{
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: reading %zu bytes\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: reading %zu bytes\n",
priv->selection, priv->target,
g_bytes_get_size (bytes)));
g_async_queue_push (priv->chunks, bytes);
notify->n_pending--;
if (notify->n_pending)
{
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: not sending SelectionNotify yet, %zu streams still pending\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: not sending SelectionNotify yet, %zu streams still pending\n",
gdk_x11_get_xatom_name_for_display (display, notify->xevent.selection),
gdk_x11_get_xatom_name_for_display (display, notify->xevent.target),
notify->n_pending));
return;
}
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: sending SelectionNotify reporting %s\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: sending SelectionNotify reporting %s\n",
gdk_x11_get_xatom_name_for_display (display, notify->xevent.selection),
gdk_x11_get_xatom_name_for_display (display, notify->xevent.target),
success ? "success" : "failure"));
if (XSendEvent (xdisplay, notify->xevent.requestor, False, NoEventMask, (XEvent*) ¬ify->xevent) == 0)
{
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: failed to XSendEvent()\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: failed to XSendEvent()\n",
gdk_x11_get_xatom_name_for_display (display, notify->xevent.selection),
gdk_x11_get_xatom_name_for_display (display, notify->xevent.target)));
}
error = gdk_x11_display_error_trap_pop (display);
if (error != Success)
{
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: X error during write: %d\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: X error during write: %d\n",
gdk_x11_get_xatom_name_for_display (display, notify->xevent.selection),
gdk_x11_get_xatom_name_for_display (display, notify->xevent.target),
error));
XWindowAttributes attrs;
priv->incr = TRUE;
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: initiating INCR transfer\n",
+ GDK_DISPLAY_NOTE (priv->display, SELECTION, g_printerr ("%s:%s: initiating INCR transfer\n",
priv->selection, priv->target));
XGetWindowAttributes (xdisplay,
PropModeReplace,
priv->data->data,
n_elements);
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: wrote %zu/%u bytes\n",
+ GDK_DISPLAY_NOTE (priv->display, SELECTION, g_printerr ("%s:%s: wrote %zu/%u bytes\n",
priv->selection, priv->target, n_elements * element_size, priv->data->len));
g_byte_array_remove_range (priv->data, 0, n_elements * element_size);
if (priv->data->len < element_size)
error = gdk_x11_display_error_trap_pop (priv->display);
if (error != Success)
{
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: X error during write: %d\n",
+ GDK_DISPLAY_NOTE (priv->display, SELECTION, g_printerr ("%s:%s: X error during write: %d\n",
priv->selection, priv->target, error));
}
g_mutex_lock (&priv->mutex);
g_byte_array_append (priv->data, buffer, count);
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: wrote %zu bytes, %u total now\n",
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: wrote %zu bytes, %u total now\n",
priv->selection, priv->target, count, priv->data->len));
g_mutex_unlock (&priv->mutex);
g_mutex_lock (&priv->mutex);
g_byte_array_append (priv->data, buffer, count);
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: async wrote %zu bytes, %u total now\n",
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: async wrote %zu bytes, %u total now\n",
priv->selection, priv->target, count, priv->data->len));
g_mutex_unlock (&priv->mutex);
needs_flush = gdk_x11_selection_output_stream_needs_flush_unlocked (stream);
g_mutex_unlock (&priv->mutex);
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: requested flush%s\n",
- priv->selection, priv->target, needs_flush ? "" : ", but not needed"));
+ GDK_NOTE (SELECTION, g_printerr ("%s:%s: requested flush%s\n",
+ priv->selection, priv->target, needs_flush ?"" : ", but not needed"));
return needs_flush;
}
xevent->xproperty.state != PropertyDelete)
return FALSE;
- GDK_NOTE(SELECTION, g_printerr ("%s:%s: got PropertyNotify Delete during INCR\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s:%s: got PropertyNotify Delete during INCR\n",
priv->selection, priv->target));
priv->delete_pending = FALSE;
if (gdk_x11_selection_output_stream_needs_flush (stream) &&
const Atom *atoms,
gsize n_atoms)
{
- GDK_NOTE(CLIPBOARD,
+ GDK_DISPLAY_NOTE (display, CLIPBOARD,
gsize i;
g_printerr ("%s: %s [ ", selection, prefix);
if (!g_output_stream_write_all_finish (G_OUTPUT_STREAM (stream), result, &bytes_written, &error))
{
- GDK_NOTE(CLIPBOARD, g_printerr ("---: failed to send targets after %zu bytes: %s\n",
+ GDK_NOTE (CLIPBOARD, g_printerr ("---: failed to send targets after %zu bytes: %s\n",
bytes_written, error->message));
g_error_free (error);
}
if (!g_output_stream_write_all_finish (G_OUTPUT_STREAM (stream), result, &bytes_written, &error))
{
- GDK_NOTE(CLIPBOARD, g_printerr ("---: failed to send timestamp after %zu bytes: %s\n",
+ GDK_NOTE (CLIPBOARD, g_printerr ("---: failed to send timestamp after %zu bytes: %s\n",
bytes_written, error->message));
g_error_free (error);
}
&n_atoms, &nbytes, (guchar **) &atoms);
if (error != Success)
{
- GDK_NOTE(SELECTION, g_printerr ("%s: XGetProperty() during MULTIPLE failed with %d\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s: XGetProperty() during MULTIPLE failed with %d\n",
selection, error));
}
else if (prop_format != 32 ||
prop_type != gdk_x11_get_xatom_by_name_for_display (display, "ATOM_PAIR"))
{
- GDK_NOTE(SELECTION, g_printerr ("%s: XGetProperty() type/format should be ATOM_PAIR/32 but is %s/%d\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s: XGetProperty() type/format should be ATOM_PAIR/32 but is %s/%d\n",
selection, gdk_x11_get_xatom_name_for_display (display, prop_type), prop_format));
}
else if (n_atoms < 2)
print_atoms (display, selection, "MULTIPLE request", atoms, n_atoms);
if (n_atoms % 2)
{
- GDK_NOTE(SELECTION, g_printerr ("%s: Number of atoms is uneven at %lu, ignoring last element\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s: Number of atoms is uneven at %lu, ignoring last element\n",
selection, n_atoms));
n_atoms &= ~1;
}
if (atoms[2 * i] == None || atoms[2 * i + 1] == None)
{
success = FALSE;
- GDK_NOTE(SELECTION, g_printerr ("%s: None not allowed as atom in MULTIPLE request\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s: None not allowed as atom in MULTIPLE request\n",
selection));
gdk_x11_pending_selection_notify_send (notify, display, FALSE);
}
else if (atoms[2 * i] == gdk_x11_get_xatom_by_name_for_display (display, "MULTIPLE"))
{
success = FALSE;
- GDK_NOTE(SELECTION, g_printerr ("%s: MULTIPLE as target in MULTIPLE request would cause recursion\n",
+ GDK_DISPLAY_NOTE (display, SELECTION, g_printerr ("%s: MULTIPLE as target in MULTIPLE request would cause recursion\n",
selection));
gdk_x11_pending_selection_notify_send (notify, display, FALSE);
}
}
#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (MISC))
+ if (GDK_DISPLAY_DEBUG_CHECK (GDK_SCREEN_DISPLAY (x11_screen), MISC))
{
static const gchar *const visual_names[] =
{
if (impl->toplevel->current_counter_value % 2 == 1)
{
-#ifdef G_ENABLE_DEBUG
- if (GDK_DEBUG_CHECK (FRAMES))
+ if (GDK_DISPLAY_DEBUG_CHECK (gdk_window_get_display (window), FRAMES))
{
XImage *image = XGetImage (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
ZPixmap);
XDestroyImage (image);
}
-#endif /* G_ENABLE_DEBUG */
/* An increment of 3 means that the frame was not drawn as fast as possible,
* but rather at a particular time. This can trigger different handling from
!fetch_card32 (&buffer, &n_entries))
goto out;
- GDK_NOTE(SETTINGS, g_message ("reading %u settings (serial %u byte order %u)", n_entries, serial, buffer.byte_order));
+ GDK_NOTE (SETTINGS, g_message ("reading %u settings (serial %u byte order %u)", n_entries, serial, buffer.byte_order));
for (i = 0; i < n_entries; i++)
{
g_value_init (value, G_TYPE_INT);
g_value_set_int (value, (gint32) v_int);
- GDK_NOTE(SETTINGS, g_message (" %s = %d", x_name, (gint32) v_int));
+ GDK_NOTE (SETTINGS, g_message (" %s = %d", x_name, (gint32) v_int));
break;
case XSETTINGS_TYPE_STRING:
{
g_value_init (value, G_TYPE_STRING);
g_value_take_string (value, s);
- GDK_NOTE(SETTINGS, g_message (" %s = \"%s\"", x_name, s));
+ GDK_NOTE (SETTINGS, g_message (" %s = \"%s\"", x_name, s));
}
break;
case XSETTINGS_TYPE_COLOR:
g_value_init (value, G_TYPE_STRING);
g_value_set_boxed (value, &rgba);
- GDK_NOTE(SETTINGS, g_message (" %s = #%02X%02X%02X%02X", x_name, alpha,red, green, blue));
+ GDK_NOTE (SETTINGS, g_message (" %s = #%02X%02X%02X%02X", x_name, alpha,red, green, blue));
}
break;
default:
/* Quietly ignore unknown types */
- GDK_NOTE(SETTINGS, g_message (" %s = ignored (unknown type %u)", x_name, type));
+ GDK_NOTE (SETTINGS, g_message (" %s = ignored (unknown type %u)", x_name, type));
break;
}
if (gdk_name == NULL)
{
- GDK_NOTE(SETTINGS, g_message (" ==> unknown to GTK"));
+ GDK_NOTE (SETTINGS, g_message (" ==> unknown to GTK"));
free_value (value);
}
else
{
- GDK_NOTE(SETTINGS, g_message (" ==> storing as '%s'", gdk_name));
+ GDK_NOTE (SETTINGS, g_message (" ==> storing as '%s'", gdk_name));
if (settings == NULL)
settings = g_hash_table_new_full (g_str_hash, g_str_equal,
#include "gtkmodulesprivate.h"
#include "gtkwindow.h"
#include "gtkwindowgroup.h"
+#include "gtkprivate.h"
+#include "gdk-private.h"
G_DEFINE_TYPE (GtkInspectorWindow, gtk_inspector_window, GTK_TYPE_WINDOW)
g_object_set_data_full (G_OBJECT (display), "gsk-renderer",
g_strdup (name), g_free);
+
+ gdk_display_set_debug_flags (display, 0);
+ gtk_set_display_debug_flags (display, 0);
}
if (!display)